<script>
import Vue from "vue";
	export default {
		onLaunch: function() {
			// 设置用户信息
			this.$store.commit("setUserData",{
				channel:"1b3938f79b5a",
				phone_no:"17621781197"
			});
			// 获取系统状态栏高度
			uni.getSystemInfo({
				success: (e)=> {
					//状态栏高度
					let StatusBar = e.statusBarHeight;
					let CustomBar = 0;
					Vue.prototype.StatusBar = StatusBar;
					this.$store.state.platform = e.platform
					// #ifndef MP
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 44;
						CustomBar = e.statusBarHeight + 44;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
						CustomBar = e.statusBarHeight + 45;
					}
					// #endif
					// #ifdef MP-WEIXIN
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
					CustomBar = custom.bottom + custom.top - e.statusBarHeight;
					// #endif
					// #ifdef MP-ALIPAY
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
					//全局混入  设置全局变量 全局方法
					//2019.9.7 see:https://juejin.im/post/5b7bb9b56fb9a019f671266a
					Vue.mixin({
						data() {
							return {
								CustomBar,
								StatusBar
							};
						}
					});
				}
			});
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>
<style lang="scss">
	@import "./static/style/iconfont.css";
	@import "./static/style/public.scss";
</style>
